<!doctype html>
<html lang="en">

	<head>
		<meta charset="UTF-8">
		<title>登录</title>
		<meta name="renderer" content="webkit|ie-comp|ie-stand">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
		<meta http-equiv="Cache-Control" content="no-siteapp" />
		<link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
		<link rel="stylesheet" href="/style/css/font.css">
		<link rel="stylesheet" href="/style/css/weadmin.css">
		<script src="/style/layui/layui.js" charset="utf-8"></script>
		<script src="/style/js/rbac_Cookie.js"></script>
		<!--<script>
			layui.use(['form', 'admin'], function() {
				var form = layui.form,
					admin = layui.admin,  
					$ = layui.jquery;
               $(function(){
               		getSharreTieba_token_LoginInfo();
		        	SetCookie("SharreTieba_token_LoginInfo",null,0);
               })
			});
		</script>-->
		
	</head>    
	<body class="login-bg">

		<div class="login">
			<div class="message">ETL数据抽取工具</div>
			<div id="darkbannerwrap"></div>
			<form method="get" class="layui-form">
				<input name="username" placeholder="用户名" type="username" lay-verify="username" class="layui-input">
				<hr class="hr15">
				<input name="password" lay-verify="pass" placeholder="密码" type="password" class="layui-input">
				<hr class="hr15">
			<!--
				<input name="yzm" lay-verify="yzm" placeholder="验证码" type="text" class="layui-input">
				<div class="w" style="width: 10em;padding-top: 1em;float: right;">
					<input type="button" id="getyzm" class="input" value="获取验证码">
				</div>
				<hr class="hr15"> -->
				<input class="loginin" value="登录" lay-submit lay-filter="login" style="width:100%;" type="submit">
				<hr class="hr20">
			</form>
		</div>


   
        <script type="text/javascript">
			layui.extend({
				admin: '{/}/style/js/admin'
			});
			layui.use(['form', 'admin'], function() {

				var form = layui.form,
					admin = layui.admin,
					$ = layui.jquery;

               $(function(){
               		getSharreTieba_token_LoginInfo();
		        	SetCookie("SharreTieba_token_LoginInfo",null,0);
               })

				form.verify({
					pass: [/(.+){6,12}$/, '密码必须6到12位'],

				});

				form.on('submit(login)', function(data) {
					debugger;
                    $.ajax({
                    	 "async": true,
						  "crossDomain": true,
						  "url": "http://localhost:8085/authorization",
						  "method": "post",
						  "headers": {
						    "Content-Type": "application/json",
						    "Cache-Control": "no-cache",
						  },
						  "processData": false,
						  "data": JSON.stringify(data.field),
                    	success:function(json){
							debugger;
                    		  if(json.code==200){
                    		  	layer.msg(json.extend.error, {
										icon: 5,
										anim: 6
									});
                    		  }else{
                    		  	SetCookie("SharreTieba_token_LoginInfo",JSON.stringify(json.extend.LoginInfo),60*1000*60*3);
                    		    windowlocationhref('/index.html');
                    		  }
                    	}
                    });
					return false;
				});

			});
		</script>
		<!-- 底部结束 -->
	</body>

</html>